package com.wx.service.impl;

import com.wx.mapper.UserMapperCustom;
import com.wx.mapper.WxUserMapper;
import com.wx.pojo.WxUser;
import com.wx.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private WxUserMapper wxUserMapper;

    @Autowired
    private UserMapperCustom userMapperCustom;

    @Override
    public List<WxUser> listUser() {
        return wxUserMapper.selectAll();
    }

    @Override
    public WxUser getUserByLogin(String username, String password) {
        return userMapperCustom.getUserByLogin(username,password);
    }

    @Override
    public WxUser getUserByUsername(String username) {
        return userMapperCustom.getUserByUsername(username);
    }

    @Override
    public Integer updatePassword(String username,
                           String password){
        return userMapperCustom.updatePassword(username,password);
    }
}
